POV-Ray : Newsgroups : povray.newusers : getting the world coordinate (x,y,z) of apixel : Re: getting the world coordinate (x,y,z) of apixel Server Time
29 Jul 2024 12:16:21 EDT (-0400)
  Re: getting the world coordinate (x,y,z) of apixel  
From: Chris B
Date: 16 Jan 2006 09:35:48
Message: <43cbaf44$1@news.povray.org>
"shimon_a10" <shi### [at] wallacoil> wrote in message 
news:web.43c92e281fd85402981d861f0@news.povray.org...
> hi,
>
> I'm a beginner at PovRay,  and i wanted to ask:
>
> 1. I'm making an image by making Box,plane,etc, and putting the camera in
>   somewhare at world coordinte.
> 2. I wanted to know how to relate an arbirary pixel in the image to the
>   world coordinate (x,y,z) that it's see.
> 3. If it possible to write me the prcedure.
> 4. please answer me in detail.
> 5. Lots of thanks.
>
> shimon
>

Hi Shimon,

The default camera is a perspective camera that acts like a pinhole camera. 
The image is constructed by tracing straight lines from the point of the 
pinhole (the position of the camera) through points on the image plane and 
on until they hit something (or not). The image plane is perpendicular to 
the direction the camera is looking in, which is controlled by the camera 
definition. The distance from the camera is defined by the direction vector 
and defaults to 1.

This is explained more comprehensively (with a diagram) in section '3.3.1 
Camera' of the POV-Ray help files.

So for a given pixel and a known camera definition you can calculate the 
equation of the line along which the ray was traced, but, from the image 
pixels you can't determine the point along that line at which it intersected 
an object (if that's what you're asking in 2.)

Chris B.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.